package br.fot.granola.oboe.controllers.activities;

import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import br.fot.granola.oboe.core.Oboe;
import br.fot.granola.oboe.util.OGLVersion;
import br.fot.granola.oboe.util.OboeRenderer;

public class Oboe3DActivity extends Activity {
	protected boolean isFullScreen = true;
	
	public static OGLVersion oglVersion = OGLVersion.OGL_10;
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        
        if( this.isFullScreen )
        {
	        this.requestWindowFeature(Window.FEATURE_NO_TITLE);
	        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
        }
        
        this.setupUI();
        
        Oboe.signalDown( this, "onCreate", savedInstanceState );
    }
    
    protected void setupUI()
    {
        OboeRenderer renderer = new OboeRenderer( this, "default", oglVersion );
    	if( oglVersion == OGLVersion.OGL_20 )
    	{
    		renderer.setEGLContextClientVersion( 2 );
    	}
        Oboe.addChild( this, renderer );
    	this.setContentView( renderer );
    }
    
    
}